From 6f170a0cf70e58e98be3b0d2a170e2f2bec02559 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 8 May 2020 23:03:53 -0400 Subject: [PATCH] testsuite: Fix listbox tests When moving from gtk_container_forall to the widget dom api, we are now iterating over all children of the listbox, including headers, separators, etc. So, skip everything that is not a listboxrow, to make the tests work again. --- testsuite/gtk/listbox.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testsuite/gtk/listbox.c b/testsuite/gtk/listbox.c index 0c646bd5d3..88b24108eb 100644 --- a/testsuite/gtk/listbox.c +++ b/testsuite/gtk/listbox.c @@ -32,6 +32,9 @@ check_sorted (GtkListBox *list) row != NULL; row = gtk_widget_get_next_sibling (row)) { + if (!GTK_IS_LIST_BOX_ROW (row)) + continue; + index = gtk_list_box_row_get_index (GTK_LIST_BOX_ROW (row)); label = gtk_list_box_row_get_child (GTK_LIST_BOX_ROW (row)); value = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (label), "data")); @@ -292,6 +295,9 @@ check_filtered (GtkListBox *list) row != NULL; row = gtk_widget_get_next_sibling (row)) { + if (!GTK_IS_LIST_BOX_ROW (row)) + continue; + if (gtk_widget_get_child_visible (row)) count++; } @@ -381,6 +387,9 @@ check_headers (GtkListBox *list) row != NULL; row = gtk_widget_get_next_sibling (row)) { + if (!GTK_IS_LIST_BOX_ROW (row)) + continue; + if (gtk_list_box_row_get_header (GTK_LIST_BOX_ROW (row)) != NULL) count++; } -- 2.30.2